

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gczn_hd/app/core/values/App_img.dart';
import 'package:gczn_hd/app/core/values/app_colors.dart';
import 'package:gczn_hd/app/core/values/app_values.dart';
import 'package:gczn_hd/app/core/values/text_styles.dart';
import 'package:gczn_hd/app/core/widget/custom_title_bar.dart';
import 'package:gczn_hd/app/modules/ppm/create_report/controllers/create_report_controller.dart';
import 'package:get/get.dart';

class FormLeft extends StatelessWidget{


  final double inputHeight = 60.0;

  @override
  Widget build(BuildContext context) {

    return Column(
      children: [
        CustomTitleBar(title: "扇叶注塑-工位A09", handleBtn: Row(
          children: [
            Text("待审核", style: fialTextStyle,)
          ],
        ),),
        _buildArticlesBeing(),
        _buildOutput(),
        _buildForm()
      ],
    );

  }

  /// 表单
  Widget _buildForm(){

    return Container(
      margin: EdgeInsets.only(top: AppValues.size36.h),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          _buildFormBc(), // 班次
          SizedBox(height: AppValues.size36.h,),
          _buildFormPerson(), // 作业人员
          SizedBox(height: AppValues.size36.h,),
          _buildFormStartTime(),
          SizedBox(height: AppValues.size36.h,),
          _buildFormEndTime(),

        ],
      ),
    );
  }

  Widget _buildFormEndTime(){

    return Row(
      children: [
        SizedBox(
          width: AppValues.size108.w,
          child: Text("作业结束", style: textStyle20Opa8,),
        ),
        SizedBox(width: AppValues.size20.w,),
        Expanded(
          flex: 1,
          child: Text("2025-1-5 19:00:00", style: textStyle,),
        )
      ],
    );
  }

  Widget _buildFormStartTime(){

    return Row(
      children: [
        SizedBox(
          width: AppValues.size108.w,
          child: Text("作业开始", style: textStyle20Opa8,),
        ),
        SizedBox(width: AppValues.size20.w,),
        Expanded(
          flex: 1,
          child: Text("2025-1-5 08:00:00", style: textStyle,),
        )
      ],
    );
  }


  /// 作业人员
  Widget _buildFormPerson(){
    return Row(
      children: [
        SizedBox(
          width: AppValues.size108.w,
          child: Text("作业人员", style: textStyle20Opa8,),
        ),
        SizedBox(width: AppValues.size20.w,),
        Expanded(
          flex: 1,
          child: Text("冠生;Thq", style: textStyle,),
        )
      ],
    );
  }


  /// 班次
  Widget _buildFormBc(){
    return Row(
      children: [
        SizedBox(
          width: AppValues.size108.w,
          child: Text("作业班次", style: textStyle20Opa8,),
        ),
        SizedBox(width: AppValues.size20.w,),
        Expanded(
          flex: 1,
          child: Text("白班", style: textStyle, maxLines: 1,),
        )
      ],
    );
  }


  Widget _buildIconArrow(){
    return Icon(Icons.arrow_forward_ios_outlined, color: AppColors.colorWhite, size: AppValues.size20.w,);
  }



  /// 产量
  Widget _buildOutput(){

    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Column(
          children: [
            Text("计划产量", style: textStyle20Opa8,),
            Text("1000", style: textStyle30Bold,)
          ],
        ),
        Column(
          children: [
            Text("计划产量", style: textStyle20Opa8,),
            Text("1000", style: textStyle30Bold,)
          ],
        ),
        Column(
          children: [
            Text("计划产量", style: textStyle20Opa8,),
            Text("1000", style: textStyle30Bold,)
          ],
        )
      ],
    );
  }


  /// 在制品
  Widget _buildArticlesBeing(){

    return Container(
      margin: EdgeInsets.only(top: AppValues.size52.h, bottom:  AppValues.size36.h),
      child: Row(
        children: [
          SizedBox(
            child: Image.asset(AppImg.goodspic, width: AppValues.size60.w, height: AppValues.size60.w,),
          ),
          SizedBox(width: AppValues.iconSize_18.w,),
          Expanded(
            flex: 1,
            child: Text("格力空气循环落地风扇", style: textStyle30, maxLines: 2, overflow: TextOverflow.ellipsis,),
          )
        ],
      ),
    );
  }

}